import 'package:flutter/cupertino.dart';
import 'package:imember/Util/Global.dart';
import 'package:imember/Util/MyColor.dart';
import 'package:imember/Widget/MyDialog.dart';
import 'package:imember/Widget/MyImage.dart';
import 'package:imember/Widget/MyInput.dart';

import '../CameraScan.dart';

class Vehicle extends StatelessWidget {
  TextEditingController controller = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Container(
        alignment: Alignment.topCenter,
        child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
          Container(height: 54),
          Text("掃描載具", style: TextStyle(fontSize: 20, color: MyColor.Orange)),
          Container(height: 69),
          Row(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
            Text("載具", style: TextStyle(fontSize: 15, color: MyColor.C70)),
            Container(
                width: 180,
                height: 35,
                decoration: BoxDecoration(
                    color: MyColor.White,
                    borderRadius: BorderRadius.all(Radius.circular(20)),
                    border: Border.all(color: MyColor.C99, width: 1)),
                margin: EdgeInsets.fromLTRB(21, 0, 0, 0),
                padding: EdgeInsets.fromLTRB(18, 0, 18, 0),
                child: NormalInput(fontSize: 15, inputType: NormalInput.Number, controller: controller))
          ]),
          Container(height: 11),
          GestureDetector(
              onTap: () {
                showWidgetDialog(context, CameraScan((value) {
                  controller.text = value;
                }));
              },
              child: Container(
                  width: 71,
                  height: 39,
                  alignment: Alignment.center,
                  decoration: Global.getBoxBg(20, MyColor.White),
                  child: LocalImage("ic_camara.png", width: 23)))
        ]));
  }
}
